package com.tzz.practice;

import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.File;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Map;

public class test001 {
    public static void main(String[] args) throws IOException {
        ObjectMapper objectMapper = new ObjectMapper();
        File file = new File("/Users/tianzizhuo/IdeaProjects/presale-platform/demo2/src/main/resources/data_model/create_activity.json");
        Map map = objectMapper.readValue(file, Map.class);
        System.out.println(map);
        System.out.println(map.get("orderType"));
        test001 test001 = new test001();
        test001.getPath();
        System.out.println(System.currentTimeMillis());

        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String dateStr = dateFormat.format(new Date(System.currentTimeMillis()));
        String replace = dateStr.replace("-", "").replace(" ", "").replace(":", "");
        System.out.println(dateStr);
        System.out.println(replace);
        ArrayList<Integer> integers = new ArrayList<>();
        integers.add(1);
        integers.add(2);
        System.out.println(integers.contains(2));
        Date date = new Date(Long.valueOf("1676976480") * 1000);
        System.out.println(date);


    }

    public void getPath(){
        System.out.println(this.getClass().getClassLoader().getResource("").getPath());
    }
}
